< previous page page_78 next page >

Page 78
Special-Purpose Controls
The last group of intrinsic controls is labeled "special purpose" because they really do not fit into a group with other controls. However, you will probably find that they still get a lot of use.
The following are the types of controls covered in this section:
ScrollBar controls
Timer control
Frame control
Scrollbars
If you have used Windows, then you are already familiar with scrollbars. Scrollbars provide a graphical way for you to perform tasks such as control your position within a document or make adjustments to your sound card volume.
Scrollbars work just like the real-world volume control on your stereo system, which can be set to any point between certain maximum and minimum values. From the programmer's point of view, the Visual Basic scrollbar controls return a numeric value; it is the programmer's responsibility to use this value appropriately in an application.
Visual Basic provides two types of scrollbars for entering numerical data: the vertical scrollbar and the horizontal scrollbar. These two controls are shown in Figure 4.15. The two scrollbars are referred to in the documentation as the VScrollBar and HScrollBar controls, respectively.
0078-01.jpg
Figure 4.15
The VScrollBar and HScrollBar controls can be
used to enter and display a numeric value graphically.
The only difference between the two controls is the orientation of the bar on the form. The following section examines the HScrollBar control, but it applies equally to the VScrollBar control.
Setting Up the Scrollbar
To use a scrollbar, you simply use properties to set and retrieve the range and value. The three most important properties, available at designtime and runtime, are as follows:
ValueRetrieves or sets the current numeric value
MinControls the minimum value of the Value property
MaxControls the maximum value of the Value property

 
< previous page page_78 next page >